﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Category1.ascx.cs" Inherits="FrontEnd_Body_Left_Category1" %>

<script type="text/javascript" language="javascript">
$(document).ready(function() {
	$("#root ul").each(function() {$(this).css("display", "none");});
	$("#root .category").click(function() {
	
		var childid = "#" + $(this).attr("childid");	
		
		if ($(childid).css("display") == "none") {$("#root ul").each(function() {$(this).css("display", "none");});$(childid).css("display", "block");}
		else {$(childid).css("display", "none");}
		
	});
});
</script>

<%-- onclick="GetListProductByCat(<%=cat.Id%>)"--%>
<div>
    <div class="category_items1">
        <ul id="root">
            <li class="name_store"><a href="#" class="border">
                <%=Component.Languages.SearchByKeyWord("kdtln")%></a></li>
            <%foreach (Component.Category cat in this._xpCategoryTL)
              { %>
            <li><a href="javascript:void(0);" childid='c_<%=cat.Id%>' class='category border'>&nbsp;&nbsp;<%=Component.CategoryDB.GetContentByLanguage(Component.ColumCategory._Name,cat)%></a>
            </li>
            <% _xpCateSub = Component.CategorySubDB.GetCategorySubByIdCat(cat.Id, false);
               if (_xpCateSub.Count > 0)
               { %>
            <ul id='c_<%=cat.Id%>'>
                <%foreach (Component.CategorySub catSub in _xpCateSub)
                  { %>
                <li><a href='javascript:void(0);' childid='c_<%=cat.Id%><%=catSub.Id%>' class='category'
                    onclick="GetListProductBySubCat(<%=catSub.Id%>)">»&nbsp;<%=Component.CategorySubDB.GetContentByLanguage(Component.ColumCategorySub._Name,catSub)%></a>
                </li>
                <%}%></ul>
            <%} %><%}%>
            <div class="category_items2">
                <div>
                    <li class="name_store"  style="margin-left:25px"><a href="#" class="border">
                        <%=Component.Languages.SearchByKeyWord("kdmln")%></a></li>
                    <%foreach (Component.Category cat1 in this._xpCategoryML)
                      { %>
                    <li  style="margin-left:25px"><a href="javascript:void(0);" childid='c_<%=cat1.Id%>' class='category border'>&nbsp;&nbsp;<span style ="font-weight:bold"><%=Component.CategoryDB.GetContentByLanguage(Component.ColumCategory._Name,cat1)%></span></a>
                    </li>
                    <% _xpCateSub = Component.CategorySubDB.GetCategorySubByIdCat(cat1.Id, false);
                       if (_xpCateSub.Count > 0)
                       { %>
                    <ul id='c_<%=cat1.Id%>'>
                        <%foreach (Component.CategorySub catSub in _xpCateSub)
                          { %>
                        <li  style="margin-left:25px"><a href='javascript:void(0);' childid='c_<%=cat1.Id%><%=catSub.Id%>' class='category'
                            onclick="GetListProductBySubCat(<%=catSub.Id%>)">»&nbsp;<%=Component.CategorySubDB.GetContentByLanguage(Component.ColumCategorySub._Name,catSub)%></a>
                        </li>
                        <%}%></ul>
                    <%} %><%}%>
                </div>
            </div>
        </ul>
    </div>
</div>
